<template>
    <div class="app-container">
        <div class="pageTitle">
            <div class="pageTitleSub">
                <el-form ref="queryForm" :model="queryParams"
                         label-width="100px" size="small">
                    <el-row :gutter="5">
                        <el-col :span="6">
                            <el-form-item label="车牌号" prop="plateNo">
                                <el-input v-model="queryParams.plateNo"
                                          placeholder="请输入车牌号" clearable/>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>
            <div class="pageBtn">
                <el-button size="small" type="primary" icon="el-icon-search"
                           @click="handleQuery">
                    查询
                </el-button>
<!--                <el-button size="small" icon="el-icon-refresh" @click="opengpy">高拍仪</el-button>-->
<!--                <el-button size="small" icon="el-icon-refresh"-->
<!--                           @click="resetQuery">-->
<!--                    重置-->
<!--                </el-button>-->
            </div>
        </div>

        <page-main>
            <el-table ref="orderTable" v-loading="isLoading" class="actionTable"
                      stripe :data="tableData"
                      header-cell-class-name="table-header" style="width: 100%;"
                      border :row-class-name="tableRowClassName">
                <el-table-column
                    prop="overloadPlateNo"
                    label="超限车车牌号码"
                    align="center" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="transferPlateNo"
                    label="转运车车牌号码"
                    align="center" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="entranceWeight"
                    label="车货总重(吨)"
                    align="right" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="limitWeight"
                    label="限载量(吨)"
                    align="right" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="overWeight"
                    label="超载量(吨)"
                    align="right" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="currentOverWeight"
                    label="当前超载总重(吨)"
                    align="right" width="120"
                    show-overflow-tooltip>
                    <template slot-scope="scope">
                        {{ scope.row.currentOverWeight }}
                    </template>
                </el-table-column>
<!--                <el-table-column-->
<!--                    prop="dealStatus"-->
<!--                    label="是否作废"-->
<!--                    align="right" width="100"-->
<!--                    show-overflow-tooltip>-->
<!--                    <template slot-scope="scope">-->
<!--                        {{ scope.row.dealStatus }}-->
<!--                    </template>-->
<!--                </el-table-column>-->
                <el-table-column
                    prop=""
                    label="操作"
                    fixed="right"
                    align="center"
                    width="850">
                    <template slot-scope="scope">
                        <el-button size="small" type="text"
                                   icon="el-icon-document-checked"
                                   @click="lawPaperwork(scope.row)">
                            确认违章
                        </el-button>
                        <el-button size="small" type="text"
                                   icon="el-icon-document"
                                   @click="handleViews(scope.$index)">
<!--                                   @click="handleViews(scope.row)">-->
                            查看超限车详情
                        </el-button>
                        <el-button size="small" type="text"
                                   icon="el-icon-document"
                                   @click="handleViewsTran(scope.$index)">
                            <!--                                   @click="handleViews(scope.row)">-->
                            查看转运车详情
                        </el-button>
                        <el-button size="small" type="text" icon="el-icon-view" @click="showVideo(scope.$index)">
                            录制监控视频
                        </el-button>
                        <el-button size="small" type="text" icon="el-icon-view" @click="showAskVideo(scope.$index)">
                            录制询问视频
                        </el-button>
                        <el-button size="small" type="text" icon="el-icon-view" @click="showUnloadVideo(scope.$index)">
                            查看卸货详情
                        </el-button>
                        <el-button size="small" type="text" icon="el-icon-view" @click="showRoomAskVideo(scope.$index)">
                            查看办公室询问视频
                        </el-button>
                        <el-button size="small" type="text" icon="el-icon-view" @click="opengpy(scope.$index)">高拍仪</el-button>
<!--                        <el-button size="small" type="text" icon="el-icon-view"-->
<!--                                   @click="showZfws(scope.row)">-->
<!--                            查看报表-->
<!--                        </el-button>-->
                    </template>
                </el-table-column>
            </el-table>

            <div class="Pagination">
                <el-pagination
                    background
                    layout="total, sizes,prev, pager, next,jumper"
                    :current-page.sync="queryParams.CurrentPage"
                    :page-size="20"
                    :page-sizes="[20]"
                    :total="totalCount"
                    @current-change="handleCurrentChange"/>
            </div>
        </page-main>

        <el-dialog title="案件处理" :visible.sync="dialogCaseInfoVisible"
                   width="1300px">
            <el-tabs type="border-card">
                <el-tab-pane label="基本信息">
                    <CaseInformation :information="information"
                                     :limit-info="limitInfo" :show="show"
                                     @cancelEstablishingCase="dialogCaseInfoVisible = false"/>
                </el-tab-pane>
                <el-tab-pane label="文书信息">
                    <InstrumentInfo :_event="wsEvent" :limit-info="limitInfo"
                                    :current-process-id="currentProcessId"/>
                </el-tab-pane>
            </el-tabs>
            <el-row :gutter="8" style="margin-top: 15px;">
                <el-col :span="12" :offset="8">
                    <el-row>
<!--                        <el-col :span="6">-->
<!--                            <el-button size="mini" type="primary" plain-->
<!--                                       @click="save">-->
<!--                                录制卸货视频-->
<!--                            </el-button>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-button size="mini" type="primary" plain-->
<!--                                       @click="saveCancellationCase">-->
<!--                                作废-->
<!--                            </el-button>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <el-button size="mini" type="primary" plain-->
<!--                                       @click="editCancellationCase">-->
<!--                                销案说明-->
<!--                            </el-button>-->
<!--                        </el-col>-->
                        <el-col :span="15">
                            <el-button size="mini" type="primary" plain
                                       @click="closeCase">
                                结案
                            </el-button>
                        </el-col>
                        <el-col :span="6">
                            <el-button size="mini" type="primary" plain
                                       @click="closeDialog">
                                关闭
                            </el-button>
                        </el-col>
                    </el-row>
                </el-col>
            </el-row>
        </el-dialog>

        <ExamDetail
            ref="examDetail"
            :total="totalCount"
            :table-size="tableSize"
            :current-page="queryParams.CurrentPage"
            :init-detail-data="detailData"
            :indexs="index"
            :oid="overloadEntranceid"
            :tid="transferEntranceid"
            :sta="sta"
            step="qt"
            :wja-type="wjaType"
            :wja="wja"
            @handleViews="handleViews"
            @handleViewsTrans="handleViewsTran"
            @getList="handleCurrentChange"/>

        <unloadVideo
            ref="unloadVideo"
            :init-detail-data="detailData"
            :sta="sta"
            step="qt"
            :wja-type="wjaType"
            :wja="wja"
            :sign="sign"
            @handleViews="handleViews"
            @handleViewsTrans="handleViewsTran"
            @getList="handleCurrentChange"
        />
        <Gpy
            ref="gpy"
            step="qt"
            :gpy-info="gpyInfo"
            />
        <roomAskVideo
            ref="roomAskVideo"
            :evidenceVideoPath="evidenceVideoPath"
            :init-detail-data="detailData"
            :sta="sta"
            step="qt"
            :wja-type="wjaType"
            :wja="wja"
            :sign="sign"
            @handleViews="handleViews"
            @handleViewsTrans="handleViewsTran"
            @getList="handleCurrentChange"
        />
<!--        <VideoPlayer-->
<!--            ref="VideoPlayer"-->
<!--            @getList="getList"-->
<!--            />-->
        <el-dialog title="执法文书"
                   :visible.sync="zfws"
                   width="70%">
            <InstrumentInfo :_event="wsEvent" :limit-info="limitInfo"
                            :current-process-id="currentProcessId"/>
        </el-dialog>

        <el-dialog title="未结案列表" :visible.sync="wjaVisible" width="80%">
            <el-table ref="orderTable" v-loading="isLoading" height="600"
                      class="actionTable" stripe :data="wjaTableData"
                      header-cell-class-name="table-header" style="width: 100%;"
                      border :row-class-name="tableRowClassName">
                <el-table-column
                    prop="plate_no"
                    label="车牌号码"
                    align="center" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="name"
                    label="检测站点"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="pass_time"
                    label="过车时间"
                    align="center" width="200">
                    <template slot-scope="scope">
                        <span>
                            {{
                                scope.row.pass_time.replace(/T/, " ").substring(0, 19)
                            }}
                        </span>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="limit_weight"
                    label="车辆限重(吨)"
                    align="right" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="vehicle_weight"
                    label="车辆重量(吨)"
                    align="right" width="120"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="over_weight"
                    label="超重(吨)"
                    align="right" width="100"
                    show-overflow-tooltip/>
                <el-table-column
                    prop="over_rate"
                    label="超限率"
                    align="right" width="100"
                    show-overflow-tooltip>
                    <template slot-scope="scope">
                        {{ scope.row.over_rate }}%
                    </template>
                </el-table-column>
                <el-table-column
                    prop="Processingstatus"
                    label="处理状态"
                    align="center" width="150"
                    show-overflow-tooltip/>
                <el-table-column
                    prop=""
                    label="操作"
                    fixed="right" align="center" width="100">
                    <template slot-scope="scope">
                        <el-button size="small" type="text" icon="el-icon-view"
                                   @click="handleWjaViews(scope.$index)">
                            查看
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button @click="wjaVisible = false">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
    import moment from 'moment';
    import CaseInformation from '@/modules/components/caseInfo/caseInformation';
    import ExamDetail from '@/modules/components/examDetail';
    import unloadVideo from '@/modules/information-query/unloadVideo';
    import {GetArchive,ConcludeCase,UpdateDealStatus} from '@/api/parkUnloadApi';
    import InstrumentInfo from '@/modules/components/instrument-info/index';
    import Gpy from '@/modules/information-query/gpy';
    import roomAskVideo from '@/modules/information-query/roomAskVideo';
    export default {
        name: 'vehicle-illegal-confirm',
        components: {
            // CancelDialog,
            // CrossingSelect, DictSelect,
            CaseInformation, ExamDetail
            , InstrumentInfo
            ,unloadVideo,
            Gpy,
            roomAskVideo
            // ,VideoPlayer
        },
        data() {
            return {
                evidenceVideoPath:'',
                sign: '',
                sta:'',
                dialogVisible: false,
                wja: '',
                wjaType: '1',
                wjaTableData: [],
                checkData: {
                    fine: '',
                    onsite_number: '',
                    nontax_number: ''
                },
                wjaVisible: false,
                wsEvent: '',
                wenzi: '',
                zfws: false,
                showTab: {
                    overrunActionProof: true,
                    overrunVehicleNotification: true
                    /* InquiryRecord: true,
                        SurveyReportCompany: true,
                        placedCaseTableCompany: true,
                        IllegalActNoticeCompany: true,
                        serviceReturnReceiptCompanyIAN: true,
                        OnSitePunishment: true,
                        OrderCorrectionNoticeCompany: true,
                        closeReportCompany: true,
                        CoverCompany: true,*/
                },
                currentProcessId: '',
                crossing_arr: [],
                plateNoColorGroup: [],
                queryParams: {
                    plateNo: '',
                    // Vehicle_weight: '',
                    // Vehicle_weight1: '',
                    // Over_rate: '',
                    // Over_rate1: '',
                    // Axle_num: '',
                    // Crossing_id: '',
                    // Pass_time1: '', // moment().format('YYYY-MM-DD') + ' 00:00:00',
                    // Pass_time2: '', // moment().add(1, 'day').format('YYYY-MM-DD') + ' 00:00:00',
                    // CurrentPage: 1,
                    // notification_status: '2',
                    // plate_select: '0',
                    // Brandless: 3
                },
                isLoading: false,
                tableData: [],
                detailData: {},
                overloadEntranceid : 0,
                transferEntranceid : 0,
                index: 0,
                tableSize: 0,
                totalCount: 0,
                dialogFormVisible: false,
                form: {
                    notifyType: '',
                    process_id: '',
                },
                dialogCaseInfoVisible: false,
                show: false,
                // 案件基本信息
                information: {},
                // 超限信息
                limitInfo: {},
                gpyInfo:{
                    archiveId:0
                },
                dialogCancellationCaseInfoVisible: false,
                dialogtest: false,
                // 销案原因
                closecase_state: '',
                sfkcFlag: false,
                dialogCancellationCaseInfo: [],
                dialogCancellationCaseInfos: []
            };
        },
        created() {
            // this.getPlantNoColor();
        },
        mounted() {

            this.getList();
            // DictionariesGroup({Group: '2005'}).then(res => {
            //     this.dialogCancellationCaseInfos = res.res.SiteMap;
            //     console.log(this.dialogCancellationCaseInfos);
            // }).catch(err => {
            //     console.log(err);
            // });
        },
        methods: {
            showRoomAskVideo(i){
                this.detailData = this.tableData[i];
                this.evidenceVideoPath = this.tableData[i].evidenceVideoPath;
                this.$refs['roomAskVideo'].show();
            },
            opengpy(i){
                // alert("123");
                this.gpyInfo.archiveId = this.tableData[i].archiveId;
                this.$refs['gpy'].show();
                // this.$refs['examDetail'].show();
            },
            showVideo(i){
                // debugger
                // this.$refs['VideoPlayer'].show();
                // this.$router.replace('/overrun-penalty-query/video-player')
                this.$router.push({
                    path: '/overrun-penalty-query/video-player',
                    query:{
                        idtest : this.tableData[i].overloadEntranceId,
                        archiveId: 0,
                    }
                })
            },
            showAskVideo(i){
                this.$router.push({
                    path: '/overrun-penalty-query/video-player',
                    query:{
                        idtest: 0,
                        archiveId : this.tableData[i].archiveId,
                    }
                })
            },
            showUnloadVideo(i){
                // debugger
                this.detailData = this.tableData[i];
                // debugger
                this.detailData.entrance_id = this.tableData[i].overloadEntranceId;
                this.sign = 'vehicle-illegal-confirm';
                this.$refs['unloadVideo'].show();
            },
            handleWjaViews(i) {
                this.wja = '1';
                this.$refs['examDetail'].show();
                // InquiryResult({process_id: this.tableData[i].process_id}).then(res => {
                //     this.wjaType = this.wjaTableData[i].Processingstatus;
                //     this.detailData = this.tableData[i];
                //     if (res.res.InquiryResult) {
                //         this.detailData.InquiryResult = res.res.InquiryResult[0];
                //         if (this.detailData.InquiryResult != null && this.detailData.InquiryResult != undefined) {
                //             if (this.detailData.InquiryResult.invalid_reason_list) {
                //                 this.detailData.InquiryResult.invalidReasons = this.detailData.InquiryResult.invalid_reason_list.split(',');
                //             }
                //             this.detailData.InquiryResult.firstIllegalType = {};
                //             if (this.detailData.InquiryResult.violative_action) {
                //                 this.detailData.InquiryResult.firstIllegalType.zdhp = this.detailData.InquiryResult.violative_action[3] == '0';
                //                 this.detailData.InquiryResult.firstIllegalType.jp = this.detailData.InquiryResult.violative_action[2] == '0';
                //                 this.detailData.InquiryResult.firstIllegalType.tp = this.detailData.InquiryResult.violative_action[1] == '0';
                //                 this.detailData.InquiryResult.firstIllegalType.yx = this.detailData.InquiryResult.violative_action[0] == '0';
                //             }
                //         }
                //         this.index = i;
                //         this.$refs['examDetail'].show();
                //         this.$forceUpdate();
                //     }
                // }).catch(err => {
                //     console.log(err);
                //     this.$message({
                //         message: '查看详情失败',
                //         type: 'error'
                //     });
                // });
            },

            MailAddressSummaryTable() {
                this.wenzi = '邮寄信息';
                this.queryParams.Table = 2;
                this.queryParams.Crossing_id = this.crossing_arr.join(',');
                if (!this.queryParams.Pass_time1) {
                    this.queryParams.Pass_time1 = '';
                }
                if (!this.queryParams.Pass_time2) {
                    this.queryParams.Pass_time2 = '';
                }
                PlacedCaseSummaryTable(this.queryParams).then(res => {
                    console.log(res.res.PlacedCaseSummaryTable);
                    this.src = res.res.PlacedCaseSummaryTable;
                    this.dialogVisible = true;
                }).catch(err => {
                    console.log(err);
                    this.$message({
                        message: '统计失败！',
                        type: 'error'
                    });
                });
            },

            PlacedCaseSummaryTable() {
                this.wenzi = '立案信息';
                this.queryParams.Table = 1;
                this.queryParams.Crossing_id = this.crossing_arr.join(',');
                if (!this.queryParams.Pass_time1) {
                    this.queryParams.Pass_time1 = '';
                }
                if (!this.queryParams.Pass_time2) {
                    this.queryParams.Pass_time2 = '';
                }
                PlacedCaseSummaryTable(this.queryParams).then(res => {
                    console.log(res.res.PlacedCaseSummaryTable);
                    this.src = res.res.PlacedCaseSummaryTable;
                    this.dialogVisible = true;
                }).catch(err => {
                    console.log(err);
                    this.$message({
                        message: '统计失败！',
                        type: 'error'
                    });
                });
            },

            openWjaList(row) {
                if (this.clickTooFast()) return;
                InquiryVehicleStatus({Plate_no: row.plate_no}).then(res => {
                    console.log(res.res);
                    this.wjaTableData = res.res.InquiryCaseClosed;
                    this.wjaVisible = true;
                }).catch(err => {
                    this.isLoading = false;
                    console.log(err);
                });
            },

            tableRowClassName({row, rowIndex}) {
                if (((this.$refs['examDetail'] && this.$refs['examDetail'].outerVisible || this.zfws || this.dialogFormVisible || this.dialogCaseInfoVisible) && row == this.detailData)) {
                    return 'selected-row';
                }
                return '';
            },

            getPlantNoColor() {
                DictionariesGroup({Group: '1003'}).then(res => {
                    this.plateNoColorGroup = res.res.SiteMap;

                }).catch(err => {
                    console.log(err);
                });
            },
            moment,
            handleQuery() {
                this.getList();
            },
            // resetQuery() {
            //     this.queryParams.Plate_no = '';
            //     this.queryParams.Vehicle_weight = '';
            //     this.queryParams.Vehicle_weight1 = '';
            //     this.queryParams.Over_rate = '';
            //     this.queryParams.Over_rate1 = '';
            //     this.queryParams.Axle_num = '';
            //     this.queryParams.Crossing_id = '';
            //     this.queryParams.Pass_time1 = '';
            //     this.queryParams.Pass_time2 = '';
            //     this.queryParams.CurrentPage = 1;
            //     this.getList();
            //
            // },
            handleCurrentChange(val) {
                this.queryParams.CurrentPage = val;
                this.getList();
            },
            showZfws(row) {
                this.detailData = row;
                this.currentProcessId = row.process_id;
                this.limitInfo = row;
                console.log("查看文书信息");
                console.log(this.limitInfo);
                this.wsEvent = '2';
                this.zfws = true;

            },
            handleViews(i) {
                // debugger
                this.sta='';
                this.index = i;
                this.wja = null;
                this.detailData = this.tableData[i];
                // debugger
                this.detailData.plateNo = this.tableData[i].overloadPlateNo;
                this.overloadEntranceid = this.tableData[i].overloadEntranceId;
                this.transferEntranceid = 0;
                this.sta='违法认定';
                this.$refs['examDetail'].show();

            },
            handleViewsTran(i) {
                // debugger
                this.sta='';
                this.index = i;
                this.wja = null;
                this.detailData = this.tableData[i];
                // debugger
                this.detailData.plateNo = this.tableData[i].transferPlateNo;
                this.overloadEntranceid = 0;
                this.transferEntranceid = this.tableData[i].transferEntranceId;
                this.sta='违法认定';
                if (this.detailData.plateNo != null){
                    this.$refs['examDetail'].show();
                } else {
                    this.$message({
                        message: '没有数据',
                        type: 'warning'
                    });
                }


            },
            // handleViews(row) {
            //     this.wja = null;
            //     this.detailData = row;
            //     this.$refs['examDetail'].show();
            // },

            getList() {
                this.isLoading = true;
                // this.queryParams.Crossing_id = this.crossing_arr.join(',');
                // if (!this.queryParams.Pass_time1) {
                //     this.queryParams.Pass_time1 = '';
                // }
                // if (!this.queryParams.Pass_time2) {
                //     this.queryParams.Pass_time2 = '';
                // }
                GetArchive(this.queryParams).then(res => {
                    this.isLoading = false;
                    this.tableData = res.res.GetArchive;
                    console.log(this.tableData);
                    // this.tableData.forEach(t => {
                    //     this.plateNoColorGroup.forEach(x => {
                    //         if (x.sysdict_code == t.plate_color) {
                    //             t.plate_color = x.sysdict_name;
                    //             return false;
                    //         }
                    //     });
                    // });
                    if (this.tableData && this.tableData.length > 0) {
                        this.totalCount = this.tableData[0].totalCount;
                    }
                    this.tableSize = this.tableData.length;
                }).catch(err => {
                    this.isLoading = false;
                    console.log(err);
                });
            },

            inform(row) {
                this.detailData = row;
                this.dialogFormVisible = true;
                this.form.process_id = row.process_id;
            },

            // 确认违章
            lawPaperwork(row) {
                this.detailData = row;
                this.openCaseInfo(row, true);
                // this.currentProcessId = row.process_id;
                // this.$confirm('是否确定该车违章?', '提示', {
                //     // distinguishCancelAndClose: true,
                //     confirmButtonText: '确定',
                //     cancelButtonText: '取消',
                //     type: 'warning'
                // }).then(() => {
                //         this.openCaseInfo(row, true);
                // }
                // ).catch(action => {
                //     this.openCaseInfo(row, false);
                // });
            },
            // 打开案件信息
            openCaseInfo(row, sfkc) {
                // debugger
                // let param = {
                //     archiveId: 0
                // };
                // if (sfkc) {
                this.wsEvent = '3';
                // } else {
                //     this.wsEvent = '4';
                // }
                // this.sfkcFlag = sfkc;
                this.information = {};
                this.limitInfo = {};
                this.limitInfo = row;
                console.log("查看文书信息");
                console.log(this.limitInfo);
                // 获取案件基本信息
                this.dialogCaseInfoVisible = true;
                // SelectBasicInformation(param).then(res => {
                //     this.information = res.res.SelectBasicInformation[0];
                //     this.dialogCaseInfoVisible = true;
                // }).catch(err => {
                //     console.log(err);
                // });
            },
            // 关闭案件信息dialog
            closeDialog() {
                this.dialogCancellationCaseInfo = [];
                this.closecase_state = '';
                this.dialogCaseInfoVisible = false;
            },
            editCancellationCase() {
                this.dialogCancellationCaseInfo = [];
                this.closecase_state = '';
                this.dialogCancellationCaseInfoVisible = true;
            },
            cancel() {
                this.closecase_state = '';
                this.dialogtest = false;
                this.dialogCancellationCaseInfoVisible = false;
            },
            btnok(){
                let param = {
                    process_id: this.currentProcessId,
                    fine: this.checkData.fine,
                    onsite_number: this.checkData.onsite_number,
                    nontax_number: this.checkData.nontax_number
                };
                CloseTheCase(param).then(res => {
                    if (res.res.CloseTheCase == 'Success' || res.res.process_id == this.currentProcessId || res.res.CloseTheCase =="结案成功") {
                        this.$message({
                            message: '结案成功',
                            type: 'success'
                        });
                        this.closeDialog();
                        this.getList();
                    } else {
                        this.$message({
                            message: res.res.CloseTheCase,
                            type: 'warning'
                        });
                    }
                }).catch(err => {
                    console.log(err);
                });
                this.dialogtest = false;
            },
            // 作废
            saveCancellationCase() {
                // if ((this.closecase_state == null || this.closecase_state == '' || this.closecase_state == ' ') && this.dialogCancellationCaseInfo.length == 0) {
                //     this.$message({
                //         message: '请填写销案说明或选择销案列表!',
                //         type: 'warning'
                //     });
                //     return;
                // }
                var list = [];
                this.dialogCancellationCaseInfo.forEach(x => {
                    list.push(Number(x.trim()));
                });
                let param = {
                    archiveId: this.detailData.archiveId,
                    dealStatus: 1,
                    // closecase_reason_list: list
                };
                UpdateDealStatus(param).then(res => {
                    if (res.status == '0' || res.res.UpdateDealStatus == 'Success' || res.res.UpdateDealStatus[0].Column1 == '确认成功') {
                        this.$message({
                            message: '作废成功',
                            type: 'success'
                        });
                        this.dialogCancellationCaseInfo = [];
                        this.closecase_state = '';
                        this.closeDialog();
                        this.getList();
                    } else {
                        this.$message({
                            message: res.res.UpdateDealStatus,
                            type: 'warning'
                        });
                    }
                }).catch(err => {
                    console.log(err);
                });
            },
            // 结案
            closeCase() {
                // debugger
                // this.dialogtest = true;
                let param = {
                    overloadEntranceId: this.limitInfo.overloadEntranceId,
                    transferEntranceId: this.limitInfo.transferEntranceId,
                    // process_id: this.currentProcessId,
                    // fine: ,
                    // onsite_number: ,
                    // nontax_number:
                };
                if (this.limitInfo.dealStatus === '未处理'){
                    this.$message({
                        message: '请正确填写违法处理状态',
                        type: 'error'
                    });
                }else {
                    ConcludeCase(param).then(res => {
                        // if (res.res.ConcludeCase == 'Success' || res.res.process_id == this.currentProcessId) {
                        if (res.res.ConcludeCase == '结案成功' || res.res.ConcludeCase[0].Column1 == '结案成功') {
                            this.$message({
                                message: '结案成功',
                                type: 'success'
                            });
                            this.closeDialog();
                            this.getList();
                        } else {
                            this.$message({
                                message: '结案失败',
                                type: 'warning'
                            });
                        }
                    }).catch(err => {
                        console.log(err);
                    });
                }
            }
        }
    };
</script>

<style scoped>
    .table-header {
        background-color: #f8f8f8 !important;
    }
    /deep/
    .el-table td {
        padding: 5px 0 !important;
    }
    /deep/
    .el-button--text {
        padding: 7px 0;
    }
    >>> .el-dialog__body {
        padding: 15px 20px;
    }

    /* >>>.el-dialog__header {
        padding: 10px 20px 10px;
    }
     */
</style>



